<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
      <el-form-item label="注册手机号" prop="mobilePhone" >
        <el-input
          v-model="queryParams.mobilePhone"
          placeholder="请输入注册手机号"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="注册时间" prop="registerTime">
        <el-date-picker clearable
          v-model="queryParams.registerTime"
          type="date"
          value-format="YYYY-MM-DD"
          placeholder="请选择注册时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="主体类型" prop="mainType">
        <el-select v-model="queryParams.mainType" placeholder="请选择主体类型" cle
                   arable style="width: 200px">
          <el-option
              v-for="dict in main_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="主体名称" prop="companyName">
        <el-input
          v-model="queryParams.companyName"
          placeholder="请输入主体名称"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="法人姓名" prop="legalPersonName">
        <el-input
          v-model="queryParams.legalPersonName"
          placeholder="请输入法人姓名"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="营业执照" prop="businessLicenseUrl">
        <el-input
          v-model="queryParams.businessLicenseUrl"
          placeholder="请输入营业执照"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>

      <!-- 省市区级联选择器-->
      <el-form-item label="地区">
        <el-col :span="6">
          <el-form-item prop="province">
            <el-select v-model="queryParams.province" placeholder="请选择省" clea
                       rable style="width: 200px" >
              <el-option v-for="item in provinceList" :key="item.code" :label="item.name" :value="item.name" @click="handleProvinceChange(item.code)">

              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item prop="city">
            <el-select v-model="queryParams.city" placeholder="请选择市" clearabl
                       e style="width: 200px" :disabled="!queryParams.province">
              <el-option v-for="item in cityList" :key="item.code" :label="item.name" :value="item.name" @click="handleCityChange(item.code)">

              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item prop="area">
            <el-select v-model="queryParams.area" placeholder="请选择区/县" clear
                       able style="width: 200px" :disabled="!queryParams.city">
              <el-option v-for="item in areaList" :key="item.code" :label="item.name" :value="item.name" @click="handleAreaChange(item.code)">

              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item prop="country">
            <el-select v-model="queryParams.country" placeholder="请选择乡镇/街道"
                       clearable style="width: 200px" :disabled="!queryParams.area">
              <el-option v-for="item in streetList" :key="item.code" :label="item.name" :value="item.name">

              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-form-item>
      <el-form-item label="联系电话" prop="phoneNumber">
        <el-input
          v-model="queryParams.phoneNumber"
          placeholder="请输入联系电话"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
        <el-button icon="Refresh" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="Plus"
          @click="handleAdd"
          v-hasPermi="['nongjt:perfect:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="Edit"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['nongjt:perfect:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="Delete"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['nongjt:perfect:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="Download"
          @click="handleExport"
          v-hasPermi="['nongjt:perfect:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="perfectList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="主键" align="center" prop="id" />
      <el-table-column label="用户注册表ID" align="center" prop="userId" width="120" />
      <el-table-column label="注册手机号" align="center" prop="mobilePhone" width="120"/>
      <el-table-column label="注册时间" align="center" prop="registerTime" width="100">
        <template #default="scope">
          <span>{{ parseTime(scope.row.registerTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>

      <el-table-column label="主体名称" align="center" prop="companyName" />
      <el-table-column label="法人姓名" align="center" prop="legalPersonName" />
      <el-table-column label="是否有营业执照" align="center" prop="businessFlag" width="120" >
        <template #default="scope">
          <el-tag v-if="scope.row.businessFlag === 1" >是</el-tag>
          <el-tag v-if="scope.row.businessFlag === 0" >否</el-tag>
        </template>
      </el-table-column>
      <el-table-column label="营业执照" align="center" prop="businessLicenseUrl" >
        <template #default="scope">
          <image-preview :src="scope.row.businessLicenseUrl"></image-preview>
        </template>
      </el-table-column>
      <el-table-column label="认证资质" align="center" prop="certificationQualificationUrl" />
      <el-table-column label="省" align="center" prop="province" />
      <el-table-column label="市" align="center" prop="city" />
      <el-table-column label="区/县" align="center" prop="area" />
      <el-table-column label="乡镇/街道" align="center" prop="country" />
      <el-table-column label="详细地址" align="center" prop="detailAddress" />
      <el-table-column label="地址编码" align="center" prop="addressCode" />
      <el-table-column label="生产类型" align="center" prop="productType">
      <template #default="scope">
        <dict-tag :options="produce_type" :value="scope.row.produceType"/>
      </template>
      </el-table-column>
      <el-table-column label="主体类型" align="center" prop="mainType">
        <template #default="scope">
          <dict-tag :options="main_type" :value="scope.row.mainType"/>
        </template>
      </el-table-column>
      <el-table-column label="主体身份" align="center" prop="subjectIdentity" />
      <el-table-column label="行业类型" align="center" prop="industryType" />
      <el-table-column label="联系电话" align="center" prop="phoneNumber" />
      <el-table-column label="统一社会信用代码" align="center" prop="creditCode" width="130" />
      <el-table-column label="证件号码" align="center" prop="idNumber" />
      <el-table-column label="注册资金" align="center" prop="registerMoney" />

      <el-table-column label="品牌logo" align="center" prop="logoUrl" >
        <template #default="scope">
          <image-preview :src="scope.row.logoUrl"></image-preview>
        </template>
      </el-table-column>
      <el-table-column label="照片墙" align="center" prop="photoWall" />
      <el-table-column label="照片墙介绍" align="center" prop="photoMsg" width="100"/>
      <el-table-column label="经度" align="center" prop="longitude" />
      <el-table-column label="纬度" align="center" prop="latitude" />
      <el-table-column label="企业成立时间" align="center" prop="foundTime" width="180">
        <template #default="scope">
          <span>{{ parseTime(scope.row.foundTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="审核状态" align="center" prop="examineStatus" >
        <template #default="scope">
          <el-tag v-if="scope.row.examineStatus === 0" >待审核</el-tag>
          <el-tag v-if="scope.row.examineStatus === 1" >审核未通过</el-tag>
          <el-tag v-if="scope.row.examineStatus === 2" >审核通过</el-tag>
        </template>
      </el-table-column>
      <el-table-column label="审核未通过原因" align="center" prop="examineMsg"  width="120"/>
      <el-table-column label="审核时间" align="center" prop="examineTime" width="180">
        <template #default="scope">
          <span>{{ parseTime(scope.row.examineTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="省平台密码" align="center" prop="sptPassword" width="90"/>
      <el-table-column label="省平台账号" align="center" prop="sptLoginName" width="90" />
      <el-table-column label="是否有省平台权限 " align="center" prop="sptAuth" width="180">
        <template #default="scope">
          <el-tag v-if="scope.row.sptAuth === 1" >是</el-tag>
          <el-tag v-if="scope.row.sptAuth === 0" >否</el-tag>
        </template>
      </el-table-column>
      <el-table-column label="是否同步到成都市" align="center" prop="isSync" width="180" >
        <template #default="scope">
          <el-tag v-if="scope.row.isSync === 1" >是</el-tag>
          <el-tag v-if="scope.row.isSync === 0" >否</el-tag>
        </template>
      </el-table-column>
      <el-table-column label="是否打印合格证抬头" align="center" prop="certificateTitleFlag" width="180" >
        <template #default="scope">
          <el-tag v-if="scope.row.certificateTitleFlag === 1" >是</el-tag>
          <el-tag v-if="scope.row.certificateTitleFlag === 0" >否</el-tag>
        </template>
      </el-table-column>
      <el-table-column label="历史签名图片" align="center" prop="signUrl" width="120" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template #default="scope">
          <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['nongjt:perfect:edit']">修改</el-button>
          <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['nongjt:perfect:remove']">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      v-model:page="queryParams.pageNum"
      v-model:limit="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改用户完善信息对话框 -->
    <el-dialog :title="title" v-model="open" width="500px" append-to-body>
      <el-form ref="perfectRef" :model="form" :rules="rules"   label-width="140px">

        <el-form-item label="主体类型" prop="mainType">
          <el-select v-model="form.mainType" placeholder="请选择主体类型">
            <el-option
                v-for="dict in main_type"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="注册手机号" prop="mobilePhone"  >
          <el-input v-model="form.mobilePhone" placeholder="请输入注册手机号" />
        </el-form-item>
        <el-form-item label="注册时间" prop="registerTime">
          <el-date-picker clearable
            v-model="form.registerTime"
            type="date"
            value-format="YYYY-MM-DD"
            placeholder="请选择注册时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="主体名称" prop="companyName">
          <el-input v-model="form.companyName" placeholder="请输入主体名称" />
        </el-form-item>
        <el-form-item label="法人姓名" prop="legalPersonName">
          <el-input v-model="form.legalPersonName" placeholder="请输入法人姓名" />
        </el-form-item>
        <el-form-item label="是否有营业执照" prop="businessFlag">
          <el-input v-model="form.businessFlag" placeholder="请输入是否有营业执照" />
        </el-form-item>
        <el-form-item label="营业执照" prop="businessLicenseUrl">
          <image-upload v-model="form.businessLicenseUrl" />
        </el-form-item>
        <el-form-item label="认证资质" prop="certificationQualificationUrl">
          <el-input v-model="form.certificationQualificationUrl" placeholder="请输入认证资质" />
        </el-form-item>
        <el-form-item label="地区">
          <el-col :span="6">
            <el-form-item prop="province">
              <el-select v-model="queryParams.province" placeholder="请选择省" clea
                         rable style="width: 200px" >
                <el-option v-for="item in provinceList" :key="item.code" :label="item.name" :value="item.name" @click="handleProvinceChange(item.code)">

                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item prop="city">
              <el-select v-model="queryParams.city" placeholder="请选择市" clearabl
                         e style="width: 200px" :disabled="!queryParams.province">
                <el-option v-for="item in cityList" :key="item.code" :label="item.name" :value="item.name" @click="handleCityChange(item.code)">

                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item prop="area">
              <el-select v-model="queryParams.area" placeholder="请选择区/县" clear
                         able style="width: 200px" :disabled="!queryParams.city">
                <el-option v-for="item in areaList" :key="item.code" :label="item.name" :value="item.name" @click="handleAreaChange(item.code)">

                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item prop="country">
              <el-select v-model="queryParams.country" placeholder="请选择乡镇/街道"
                         clearable style="width: 200px" :disabled="!queryParams.area">
                <el-option v-for="item in streetList" :key="item.code" :label="item.name" :value="item.name">

                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-form-item>
        <el-form-item label="详细地址" prop="detailAddress">
          <el-input v-model="form.detailAddress" placeholder="请输入详细地址" />
        </el-form-item>
        <el-form-item label="地址编码" prop="addressCode">
          <el-input v-model="form.addressCode" placeholder="请输入地址编码" />
        </el-form-item>
        <el-form-item label="主体身份" prop="subjectIdentity">
          <el-input v-model="form.subjectIdentity" placeholder="请输入主体身份" />
        </el-form-item>
        <el-form-item label="联系电话" prop="phoneNumber">
          <el-input v-model="form.phoneNumber" placeholder="请输入联系电话" />
        </el-form-item>
        <el-form-item label="统一社会信用代码" prop="creditCode">
          <el-input v-model="form.creditCode" placeholder="请输入统一社会信用代码" />
        </el-form-item>
        <el-form-item label="证件号码" prop="idNumber">
          <el-input v-model="form.idNumber" placeholder="请输入证件号码" />
        </el-form-item>
        <el-form-item label="注册资金" prop="registerMoney">
          <el-input v-model="form.registerMoney" placeholder="请输入注册资金" />
        </el-form-item>
        <el-form-item label="品牌logo" prop="logoUrl">
        <image-upload v-model="form.logoUrl" />
        </el-form-item>

        <el-form-item label="照片墙" prop="photoWall">
          <el-input v-model="form.photoWall" placeholder="请输入照片墙" />
        </el-form-item>
        <el-form-item label="照片墙介绍" prop="photoMsg">
          <el-input v-model="form.photoMsg" placeholder="请输入照片墙介绍" />
        </el-form-item>
        <el-form-item label="经度" prop="longitude">
          <el-input v-model="form.longitude" placeholder="请输入经度" />
        </el-form-item>
        <el-form-item label="纬度" prop="latitude">
          <el-input v-model="form.latitude" placeholder="请输入纬度" />
        </el-form-item>
        <el-form-item label="企业成立时间" prop="foundTime">
          <el-date-picker clearable
            v-model="form.foundTime"
            type="date"
            value-format="YYYY-MM-DD"
            placeholder="请选择企业成立时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="审核未通过原因" prop="examineMsg">
          <el-input v-model="form.examineMsg" placeholder="请输入审核未通过原因" />
        </el-form-item>
        <el-form-item label="审核时间" prop="examineTime">
          <el-date-picker clearable
            v-model="form.examineTime"
            type="date"
            value-format="YYYY-MM-DD"
            placeholder="请选择审核时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="省平台密码" prop="sptPassword">
          <el-input v-model="form.sptPassword" placeholder="请输入省平台密码" />
        </el-form-item>
        <el-form-item label="省平台账号" prop="sptLoginName">
          <el-input v-model="form.sptLoginName" placeholder="请输入省平台账号" />
        </el-form-item>
        <el-form-item label="是否有省平台权限 " prop="sptAuth">
          <el-input v-model="form.sptAuth" placeholder="请输入是否有省平台权限 " />
        </el-form-item>
        <el-form-item label="是否同步到成都市" prop="isSync">
          <el-input v-model="form.isSync" placeholder="请输入是否同步到成都市，0：无需同步，1：需要同步" />
        </el-form-item>
        <el-form-item label="是否打印合格证抬头" prop="certificateTitleFlag">
          <el-input v-model="form.certificateTitleFlag" placeholder="请输入是否打印合格证抬头" />
        </el-form-item>
        <el-form-item label="历史签名图片" prop="signUrl">
          <el-input v-model="form.signUrl" placeholder="请输入历史签名图片" />
        </el-form-item>
        <el-form-item label="删除标记 " prop="delFlag">
          <el-input v-model="form.delFlag" placeholder="请输入删除标记 " />
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submitForm">确 定</el-button>
          <el-button @click="cancel">取 消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script setup name="Perfect">
import { listPerfect, getPerfect, delPerfect, addPerfect, updatePerfect } from "@/api/nongjt/perfect"
import { areaSelect } from "@/composables/AreaSelect"




const { proxy } = getCurrentInstance()

const perfectList = ref([])
const open = ref(false)
const loading = ref(true)
const showSearch = ref(true)
const ids = ref([])
const single = ref(true)
const multiple = ref(true)
const total = ref(0)
const title = ref("")
// 加载字典
const { main_type } = proxy.useDict('main_type')
const { produce_type } = proxy.useDict('produce_type')
// 使⽤ areaSelect 组合式函数
const {
  provinceList,
  cityList,
  areaList,
  streetList,
  initProvinceList,
  provinceChange,
  cityChange,
  areaChange,
  resetAreaList
} = areaSelect()
// 2.定义模型
// 创建⼀个专⻔⽤于地区选择的模型
const areaModel = computed(() => {
  return {
    province: queryParams.value.province,
    city: queryParams.value.city,
    area: queryParams.value.area,
    country: queryParams.value.country
  }
})
// 更新地区模型
function updateAreaModel(model) {
  queryParams.value.province = model.province
  queryParams.value.city = model.city
  queryParams.value.area = model.area
  queryParams.value.country = model.country
}
const data = reactive({
  form: {},
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    mobilePhone: null,
    registerTime: null,
    companyName: null,
    legalPersonName: null,
    businessLicenseUrl: null,
    province: null,
    city: null,
    area: null,
    country: null,
    phoneNumber: null,
  },
  rules: {
    mobilePhone: [
      { required: true, message: "注册手机号不能为空", trigger: "blur" }
    ],
    registerTime: [
      { required: true, message: "注册时间不能为空", trigger: "blur" }
    ],
    companyName: [
      { required: true, message: "主体名称不能为空", trigger: "blur" }
    ],
    legalPersonName: [
      { required: true, message: "法人姓名不能为空", trigger: "blur" }
    ],
    businessFlag: [
      { required: true, message: "是否有营业执照不能为空", trigger: "blur" }
    ],
    businessLicenseUrl: [
      { required: true, message: "营业执照不能为空", trigger: "blur" }
    ],
    province: [
      { required: true, message: "省不能为空", trigger: "blur" }
    ],
    city: [
      { required: true, message: "市不能为空", trigger: "blur" }
    ],
    area: [
      { required: true, message: "区/县不能为空", trigger: "blur" }
    ],
    country: [
      { required: true, message: "乡镇/街道不能为空", trigger: "blur" }
    ],
    detailAddress: [
      { required: true, message: "详细地址不能为空", trigger: "blur" }
    ],
    produceType: [
      { required: true, message: "生产类型不能为空", trigger: "change" }
    ],
    mainType: [
      { required: true, message: "主体类型不能为空", trigger: "change" }
    ],
    phoneNumber: [
      { required: true, message: "联系电话不能为空", trigger: "blur" }
    ],
    creditCode: [
      { required: true, message: "统一社会信用代码不能为空", trigger: "blur" }
    ],
    registerMoney: [
      { required: true, message: "注册资金不能为空", trigger: "blur" }
    ],
  }
})

const { queryParams, form, rules } = toRefs(data)
// 定义对应⽅法
// 省份选择改变时
function handleProvinceChange(value) {
  // 重置市、区、街道
  queryParams.value.city = null
  queryParams.value.area = null
  queryParams.value.country = null
  cityList.value = []
  areaList.value = []
  streetList.value = []
  if (value) {
    provinceChange(value)
  }
}
// 市选择改变时
function handleCityChange(value) {
  // 重置区、街道
  queryParams.value.area = null
  queryParams.value.country = null
  areaList.value = []
  streetList.value = []
  if (value) {
    cityChange(value)
  }
}
// 区/县选择改变时
function handleAreaChange(value) {
  // 重置街道
  queryParams.value.country = null
  streetList.value = []
  if (value) {
    areaChange(value)
  }
}

/** 查询用户完善信息列表 */
function getList() {
  loading.value = true
  listPerfect(queryParams.value).then(response => {
    perfectList.value = response.rows
    total.value = response.total
    loading.value = false
  })
}

// 取消按钮
function cancel() {
  open.value = false
  reset()
}

// 表单重置
function reset() {
  form.value = {
    id: null,
    userId: null,
    mobilePhone: null,
    registerTime: null,
    companyName: null,
    legalPersonName: null,
    businessFlag: null,
    businessLicenseUrl: null,
    certificationQualificationUrl: null,
    province: null,
    city: null,
    area: null,
    country: null,
    detailAddress: null,
    addressCode: null,
    produceType: null,
    mainType: null,
    subjectIdentity: null,
    industryType: null,
    phoneNumber: null,
    creditCode: null,
    idNumber: null,
    registerMoney: null,
    logoUrl: null,
    photoWall: null,
    photoMsg: null,
    longitude: null,
    latitude: null,
    foundTime: null,
    examineStatus: null,
    examineMsg: null,
    examineTime: null,
    sptPassword: null,
    sptLoginName: null,
    sptAuth: null,
    isSync: null,
    certificateTitleFlag: null,
    signUrl: null,
    delFlag: null,
    createBy: null,
    createTime: null,
    updateBy: null,
    updateTime: null
  }
  proxy.resetForm("perfectRef")
}

/** 搜索按钮操作 */
function handleQuery() {
  queryParams.value.pageNum = 1
  getList()
}

/** 重置按钮操作 */
function resetQuery() {
  proxy.resetForm("queryRef")
  handleQuery()
}

// 多选框选中数据
function handleSelectionChange(selection) {
  ids.value = selection.map(item => item.id)
  single.value = selection.length != 1
  multiple.value = !selection.length
}

/** 新增按钮操作 */
function handleAdd() {
  reset()
  open.value = true
  title.value = "添加用户完善信息"
}

/** 修改按钮操作 */
function handleUpdate(row) {
  reset()
  const _id = row.id || ids.value
  getPerfect(_id).then(response => {
    form.value = response.data
    open.value = true
    title.value = "修改用户完善信息"
  })
}

/** 提交按钮 */
function submitForm() {
  proxy.$refs["perfectRef"].validate(valid => {
    if (valid) {
      if (form.value.id != null) {
        updatePerfect(form.value).then(response => {
          proxy.$modal.msgSuccess("修改成功")
          open.value = false
          getList()
        })
      } else {
        addPerfect(form.value).then(response => {
          proxy.$modal.msgSuccess("新增成功")
          open.value = false
          getList()
        })
      }
    }
  })
}

/** 删除按钮操作 */
function handleDelete(row) {
  const _ids = row.id || ids.value
  proxy.$modal.confirm('是否确认删除用户完善信息编号为"' + _ids + '"的数据项？').then(function() {
    return delPerfect(_ids)
  }).then(() => {
    getList()
    proxy.$modal.msgSuccess("删除成功")
  }).catch(() => {})
}

/** 导出按钮操作 */
function handleExport() {
  proxy.download('nongjt/perfect/export', {
    ...queryParams.value
  }, `perfect_${new Date().getTime()}.xlsx`)
}

getList()
initProvinceList()
</script>
